package com.hotel.service;

import com.hotel.dao.CheckMapper;
import com.hotel.pojo.Check;


import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
@RequiredArgsConstructor
public class CheckServiceImpl implements CheckService{

private final CheckMapper checkMapper;
    @Override
    public void addCheck(Check check) {
        checkMapper.addCheck(check);
    }

    @Override
    public void deleteCheckById(Integer id) {
        checkMapper.deleteCheckById(id);
    }

    @Override
    public List<Check> queryAllChecks() {
       return checkMapper.queryAllChecks();
    }

    @Override
    public Check queryCheckById(Integer id) {
        return checkMapper.queryCheckById(id);
    }

    @Override
    public void updateCheckById(Check check) {

        checkMapper.updateCheckById(check);
    }

    @Override
    public Check queryCheckByRoomNumber(String roomNumber) {
        return  checkMapper.queryCheckByRoomNumber(roomNumber);
    }

    @Override
    public void updateStatusAndTimeById(Check check) {
        checkMapper.updateStatusById(check);
    }

    @Override
    public List<Check> queryAll() {
       return checkMapper.queryAll();
    }
}
